{% if 'pelican.plugins.search' in PLUGINS %}
  <script>
    window.loadStorkIndex = function () {
      {% if not STORK_VERSION %}
      stork.initialize("{{ SITEURL }}/{{ THEME_STATIC_DIR }}/stork/stork.wasm")
      {% endif %}
      stork.register("sitesearch", "{{ SITEURL }}/search-index.st", { showProgress: false });
    }
  </script>
  {% if STORK_VERSION %}
  <script src="https://files.stork-search.net/releases/v{{ STORK_VERSION }}/stork.js"></script>
  {% else %}
  <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/stork/stork.js"></script>
  {% endif %}
{% endif %}
